Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

normalize-svg-path

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-svg-path

Convert all segments in a path to curves

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is normalize-svg-path?

The normalize-svg-path npm package is used to normalize SVG path data. It converts all path commands to their absolute forms and can also convert shorthand commands to their full forms. This is useful for simplifying the manipulation and analysis of SVG path data.

What are normalize-svg-path's main functionalities?

Convert all path commands to absolute

This feature converts all relative path commands to their absolute equivalents. For example, 'h 80' becomes 'H 90' if the current point is (10, 10).

const normalize = require('normalize-svg-path');
const pathData = 'M10 10 h 80 v 80 h -80 Z';
const normalizedPath = normalize(pathData);
console.log(normalizedPath);

Expand shorthand commands

This feature expands shorthand commands to their full forms. For example, 'h 80' becomes 'H 90' and 'v 80' becomes 'V 90'.

const normalize = require('normalize-svg-path');
const pathData = 'M10 10 h 80 v 80 h -80 Z';
const expandedPath = normalize(pathData, { expandShorthand: true });
console.log(expandedPath);

Other packages similar to normalize-svg-path

Keywords

FAQs

Package last updated on 18 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc